//
//  HotListTableViewCell.m
//  GoShops
//
//  Created by zcj on 15-12-4.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//

#import "HotListTableViewCell.h"
#import "JFMenuBtnView.h"
#import "Grouble.h"

@implementation HotListTableViewCell
+(instancetype)HotListTableViewCell:(UITableView *)tableView hotWithArray:(NSArray *)menuArray
{
    
    static NSString *ID = @"cchotList";
    HotListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[HotListTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID  hotWithArray:(NSArray *)menuArray];
    }
    // 设置不能选中,选中每反应
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier  hotWithArray:(NSArray *)menuArray
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //创建8个
        for (int i = 0; i < 4; i++) {
                CGRect frame = CGRectMake(i*ScreenWidth/4, 0, ScreenWidth/4, 80);
                NSString *title = [menuArray[i+3] objectForKey:@"title"];
                NSString *imageStr = [menuArray[i+3] objectForKey:@"image"];
                JFMenuBtnView *btnView = [[JFMenuBtnView alloc] initWithFrame:frame title:title imageStr:imageStr];
                btnView.tag = 10+i;
                [self addSubview:btnView];
                UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(OnTapBtnView:)];
                [btnView addGestureRecognizer:tap];
            }

        // Initialization code
    }
    return self;
}
- (void)OnTapBtnView:(UIGestureRecognizer *)gester
{
    ZCJLog(@"dkljfkldfjldlfjdklf");
}
- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
